import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { NetworkLatitudeVO, NetworkLatitudeForm, NetworkLatitudeQuery } from '@/api/commission/networkLatitude/types';

/**
 * 查询网点纬度列表
 * @param query
 * @returns {*}
 */

export const listNetworkLatitude = (query?: NetworkLatitudeQuery): AxiosPromise<NetworkLatitudeVO[]> => {
  return request({
    url: '/commission/networkLatitude/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询网点纬度详细
 * @param id
 */
export const getNetworkLatitude = (id: string | number): AxiosPromise<NetworkLatitudeVO> => {
  return request({
    url: '/commission/networkLatitude/' + id,
    method: 'get'
  });
};

/**
 * 新增网点纬度
 * @param data
 */
export const addNetworkLatitude = (data: NetworkLatitudeForm) => {
  return request({
    url: '/commission/networkLatitude',
    method: 'post',
    data: data
  });
};

/**
 * 修改网点纬度
 * @param data
 */
export const updateNetworkLatitude = (data: NetworkLatitudeForm) => {
  return request({
    url: '/commission/networkLatitude',
    method: 'put',
    data: data
  });
};

/**
 * 删除网点纬度
 * @param id
 */
export const delNetworkLatitude = (id: string | number | Array<string | number>) => {
  return request({
    url: '/commission/networkLatitude/' + id,
    method: 'delete'
  });
};
